﻿<!--
******************************************************************************************************
//  NetworkDetailView.xaml
//
//  Copyright © 2014, Kevin D. Jones.  All Rights Reserved.
//
//  This file is licensed to you under the Eclipse Public License -v 1.0 (the "License"); you may
//  not use this file except in compliance with the License. You may obtain a copy of the License at:
//
//      http://www.opensource.org/licenses/eclipse-1.0.php
//
//  Unless agreed to in writing, the subject software distributed under the License is distributed on an
//  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
//  License for the specific language governing permissions and limitations.
//
//  Code Modification History:
//  **************************************************************************************************
//  02/01/2014 - Kevin D. Jones
//       Generated original version of source code.
//
//****************************************************************************************************
-->
<UserControl x:Class="StartingFromScratch.Views.NetworkDetailView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModels="clr-namespace:StartingFromScratch.ViewModels"
             xmlns:System="clr-namespace:System;assembly=mscorlib"
             xmlns:Synchrophasor="clr-namespace:SynchrophasorAnalytics.Modeling;assembly=SynchrophasorAnalytics"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="600">
    <UserControl.DataContext>
        <viewModels:NetworkDetailViewModel/>
    </UserControl.DataContext>
    <UserControl.Resources>
        <ObjectDataProvider x:Key="SwitchingDeviceNormalStateEnumeration" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="Synchrophasor:SwitchingDeviceNormalState"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <Style TargetType="Label" x:Key="SegoeFontStyle">
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="FontSize" Value="14" />
            <Setter Property="FontWeight" Value="Light" />
        </Style>
        <Style TargetType="Label" x:Key="LabelStyle" BasedOn="{StaticResource SegoeFontStyle}">
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="ComboBox" x:Key="ComboBoxStyle">
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="FontSize" Value="14" />
            <Setter Property="FontWeight" Value="Light" />
        </Style>
        <Style TargetType="TextBox" x:Key="TextBoxStyle">
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="FontSize" Value="14" />
            <Setter Property="FontWeight" Value="Light" />
        </Style>
        <Style TargetType="CheckBox" x:Key="CheckBoxStyle">
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="FontSize" Value="14" />
            <Setter Property="FontWeight" Value="Light" />
        </Style>
    </UserControl.Resources>
    <StackPanel Orientation="Vertical" >
        <Label Padding="20" Content="Line Segment Detail" FontSize="25" Style="{StaticResource SegoeFontStyle}"/>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" MinWidth="120"/>
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" MinWidth="120"/>
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" MinWidth="120"/>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.Column="1" Content="Internal ID" Style="{StaticResource LabelStyle}"/>
            <Label Grid.Row="2" Grid.Column="1" Content="Number" Style="{StaticResource LabelStyle}"/>
            <Label Grid.Row="4" Grid.Column="1" Content="Name" Style="{StaticResource LabelStyle}"/>
            <Label Grid.Row="6" Grid.Column="1" Content="Description" Style="{StaticResource LabelStyle}"/>
            <Label Grid.Row="8" Grid.Column="1" Content="Parent Transmission Line" Style="{StaticResource LabelStyle}"/>
            <Label Grid.Row="10" Grid.Column="1" Content="From Node" Style="{StaticResource LabelStyle}"/>
            <Label Grid.Row="12" Grid.Column="1" Content="To Node" Style="{StaticResource LabelStyle}"/>
            
            <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=InternalId}" Style="{StaticResource TextBoxStyle}" Validation.ErrorTemplate="{StaticResource IntegerValidationTemplate}"/>
            <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Path=Number}" Style="{StaticResource TextBoxStyle}" Validation.ErrorTemplate="{StaticResource IntegerValidationTemplate}"/>
            <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding Path=Name}" Style="{StaticResource TextBoxStyle}"/>
            <TextBox Grid.Row="6" Grid.Column="3" Text="{Binding Path=Description}" Style="{StaticResource TextBoxStyle}"/>
            <ComboBox Grid.Row="8" Grid.Column="3" ItemsSource="{Binding Path=TransmissionLines}" DisplayMemberPath="Name" SelectedValue="{Binding ParentTransmissionLine}" Style="{StaticResource ComboBoxStyle}"/>
            <ComboBox Grid.Row="10" Grid.Column="3" ItemsSource="{Binding Path=FromNodes}" DisplayMemberPath="Description" SelectedValue="{Binding FromNode}" Style="{StaticResource ComboBoxStyle}"/>
            <ComboBox Grid.Row="12" Grid.Column="3" ItemsSource="{Binding Path=ToNodes}" DisplayMemberPath="Description" SelectedValue="{Binding ToNode}" Style="{StaticResource ComboBoxStyle}"/>
            <TabControl Grid.Row="14" Grid.RowSpan="10" Grid.Column="1" Grid.ColumnSpan="7" >
                <TabItem Header="Resistance"  MinWidth="130">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="3" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="10" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="3" />
                            <RowDefinition Height="*" />

                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*" MinWidth="100"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*" MinWidth="100"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*" MinWidth="100"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="3" />
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Label Grid.Row="0" Grid.Column="1" Content="R1" Style="{StaticResource LabelStyle}"/>
                        <Label Grid.Row="2" Grid.Column="1" Content="R2" Style="{StaticResource LabelStyle}"/>
                        <Label Grid.Row="2" Grid.Column="3" Content="R3" Style="{StaticResource LabelStyle}"/>
                        <Label Grid.Row="4" Grid.Column="1" Content="R4" Style="{StaticResource LabelStyle}"/>
                        <Label Grid.Row="4" Grid.Column="3" Content="R5" Style="{StaticResource LabelStyle}"/>
                        <Label Grid.Row="4" Grid.Column="5" Content="R6" Style="{StaticResource LabelStyle}"/>
                        
                        <TextBox Grid.Row="0" Grid.Column="2" Text="{Binding Path=R1}" Style="{StaticResource TextBoxStyle}"/>
                        <TextBox Grid.Row="2" Grid.Column="2" Text="{Binding Path=R2}" Style="{StaticResource TextBoxStyle}"/>
                        <TextBox Grid.Row="2" Grid.Column="4" Text="{Binding Path=R3}" Style="{StaticResource TextBoxStyle}"/>
                        <TextBox Grid.Row="4" Grid.Column="2" Text="{Binding Path=R4}" Style="{StaticResource TextBoxStyle}"/>
                        <TextBox Grid.Row="4" Grid.Column="4" Text="{Binding Path=R5}" Style="{StaticResource TextBoxStyle}"/>
                        <TextBox Grid.Row="4" Grid.Column="6" Text="{Binding Path=R6}" Style="{StaticResource TextBoxStyle}"/>

                        <Label Grid.Row="0" Grid.Column="4" Content="{Binding Path=R2}" Style="{StaticResource LabelStyle}"/>
                        <Label Grid.Row="0" Grid.Column="6" Content="{Binding Path=R4}" Style="{StaticResource LabelStyle}"/>
                        <Label Grid.Row="2" Grid.Column="6" Content="{Binding Path=R5}" Style="{StaticResource LabelStyle}"/>

                    </Grid>
                </TabItem>
                <TabItem Header="Reactance" MinWidth="130">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="5" />
                            <ColumnDefinition Width="*" MinWidth="150"/>
                        </Grid.ColumnDefinitions>
                    </Grid>
                </TabItem>
                <TabItem Header="Shunt Susceptance" MinWidth="130">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="5" />
                            <ColumnDefinition Width="*" MinWidth="150"/>
                        </Grid.ColumnDefinitions>
                    </Grid>
                </TabItem>
            </TabControl>
        </Grid>
    </StackPanel>
</UserControl>
